package com.wyc.serviceMap.controller;

import com.wyc.internalCommon.request.DirectionDTO;
import com.wyc.internalCommon.request.ForecastPriceDTO;
import com.wyc.internalCommon.result.ApiResult;
import com.wyc.serviceMap.service.DirectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 预算运价Controller
 */
@RestController
@RequestMapping("/direction")
public class DirectionController {

    @Autowired
    private DirectionService directionService;

    /**
     * 根据起点/终点经纬度获取距离和时长
     * @param forecastPriceDTO
     * @return
     */
    @PostMapping("/driving")
    public ApiResult<DirectionDTO> driving(@RequestBody ForecastPriceDTO forecastPriceDTO){

        return directionService.driving(forecastPriceDTO);
    }

}
